/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Datos;

import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author HOUSE
 */
public  class Conectar {
   Connection conexion;
    public Connection getConection() {
       if (conexion == null) {
           try {
               Driver driver = new com.mysql.jdbc.Driver();
               DriverManager.registerDriver(driver);
               conexion = DriverManager.getConnection("jdbc:mysql://localhost:3306/automotora", "root", "pass1234");
              
           } catch (SQLException ex) {
               ex.printStackTrace();
               Logger.getLogger(DBUsuario.class.getName()).log(Level.SEVERE, null, ex);

           }
       }
       return conexion;
   }
}
